import cryptoJS from 'crypto-js'
export const userInfo = 'h5_userInfo'
/**
 * md5加盐密码
 */
export function signPwd (pwd) {
  return cryptoJS.MD5(pwd).toString()
}

/**
 * 存储sessionStorage
 */
export function setSession (key, obj) {
  let value = JSON.stringify(obj)
  sessionStorage.setItem(key, value)
}

/**
 * 获取sessionStorage
 */
export function getSession (key) {
  let value = sessionStorage.getItem(key)
  let obj = {}
  if (value) {
    obj = JSON.parse(value)
  }
  return obj
}
